﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataWin.Core.ORM;
using DataWin.Core.Model;
using DataWin.Core.Util;

namespace DWEIP.BLL
{
    public class UserLogin
    {

        private void GetTam05()
        {
            ISession _Session = null;
            Dictionary<String, String> _Config = new Dictionary<string, string>();
            //Server : 資料庫服務器
            _Config["Server"] = "192.168.104.60";
            //Database: 資料庫名稱
            _Config["Database"] = "ADEMO2014";
            //User: 資料庫登錄用戶
            _Config["User"] = "sa";
            //DBPassWord: 資料庫登錄口令
            _Config["DBPassWord"] = "sa";

            _Config["HostName"] = "jizhen-pc";

            try
            {
                _Session = SessionFactory.GetInstance().OpenSession(_Config);
                _Session.BeginTransaction();
                Table _tam05 = new Table("tam05");
                _tam05.Config = _Config;
                _tam05.SQL.Value = "SELECT * FROM tam05 WHERE ae01=@ae01";
                _tam05.Params.Clear();
                _tam05.Params.Add("ae01", new Data("jizhen"));
                _Session.Load(_tam05);
                _Session.Commit();
            }
            catch
            {
                if (_Session != null)
                {
                    try
                    {
                        _Session.Rollback();
                    }
                    catch
                    {
                    }
                }
                throw;
            }
        }

    }


}
